home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / g_quake / server1.zip / _KCKSCDR.QC < prev    next >
Text File  |  1996-08-30  |  2KB  |  63 lines

  1. /*
  2. **
  3. ** _kckscdr.qc (KickSuicider Code , 1.3)
  4. **
  5. ** Copyright (C) 1996 Johannes Plass
  6. ** 
  7. ** This program is free software; you can redistribute it and/or modify
  8. ** it under the terms of the GNU General Public License as published by
  9. ** the Free Software Foundation; either version 2 of the License, or
  10. ** (at your option) any later version.
  11. ** 
  12. ** This program is distributed in the hope that it will be useful,
  13. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. ** GNU General Public License for more details.
  16. **
  17. ** You should have received a copy of the GNU General Public License
  18. ** along with this program; if not, write to the Free Software
  19. ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. ** 
  21. ** Author:   Johannes Plass (plass@dipmza.physik.uni-mainz.de)
  22. **
  23. */
  24.  
  25. void(entity player) KickSuiciderInit =
  26. {
  27.    if (!USE_MODULE_KICKSUICIDER) return;
  28.    // nothing to be done here.
  29.    // player.kick_suicider_lasttime is initialized in 
  30.    // function PutClientInServer() in client.qc
  31. };
  32.  
  33. void(entity player) KickSuiciderInfo =
  34. {
  35.    local string limit;
  36.  
  37.    if (!USE_MODULE_KICKSUICIDER) return;
  38.  
  39.    //             123456789#123456789#123456789#12345678
  40.    sprint(player,"# KickSuicider: You will be kicked\n");
  41.    sprint(player,"  for 2 suicides within 2 minutes.\n");
  42. };
  43.  
  44. float(entity player) KickSuicider =
  45. {
  46.    if (!USE_MODULE_KICKSUICIDER) return;
  47.  
  48.    if (time < player.kick_suicider_lasttime + 120) {
  49.       if (USE_MODULE_SERVERCONSOLE) {    //#jp#(ServerConsole)
  50.          dprint("Kicking ");        //#jp#(ServerConsole)
  51.          dprint(player.netname);    //#jp#(ServerConsole)
  52.          dprint(" for suiciding\n");    //#jp#(ServerConsole)
  53.       }                    //#jp#(ServerConsole)
  54.       sprint (player,"Suiciders suck, you are kicked.\n");
  55.       stuffcmd(player,"disconnect\n");
  56.       return(1);
  57.    }
  58.    player.kick_suicider_lasttime = time;
  59.    return(0);
  60. };
  61.  
  62.  
  63.